import { request } from '../request';

export function list(param: String) {
    return request.get<any>(`/nurse_nurses/nurseNurses/listByWeChat${param}`, {}, {
        useErrMsg: true
    });
}

// export function queryById(id: String) {
//     return request.get<any>(`/nurse_nurses/nurseNurses/queryById?id=${id}`, {}, {
//         useErrMsg: true
//     });
// }
export function queryById(id: String) {
    return request.get<any>(`/nurse_nurses/nurseNurses/queryById?id=${id}`, {}, {
        useErrMsg: true
    });
}


export function listNurseNursesCertificateByMainId(id: String) {
    return request.get<any>(`/nurse_nurses/nurseNurses/listNurseNursesCertificateByMainId?nursesId=${id}`, {}, {
        useErrMsg: true
    });
}


export function listNurseNursesCommentByMainId(id: String) {
    return request.get<any>(`/nurse_nurses/nurseNurses/listNurseNursesCommentByMainId?nursesId=${id}`, {}, {
        useErrMsg: true
    });
}

export function getNursesOrders(id: String) {
    return request.get<any>(`/nurse_user_orders_nurses/nurseUserOrdersNurses/listByWeChat?nursesId=${id}`, {}, {
        useErrMsg: true
    });
}

export function addNurseUserOrdersNursesExecute(data: any) {
    return request.post<any>(`/nurse_user_orders_nurses/nurseUserOrdersNurses/addNurseUserOrdersNursesExecute`, data, {
        useErrMsg: true
    });
}

export function getEncode(openid: string) {
    return request.get<any>(`/nurse_nurses/nurseNurses/getEncode?openid=${openid}`, {}, {
        useErrMsg: true
    });
}

export function login(data: any) {
    return request.post<any>(`/nurse_nurses/nurseNurses/login`, data, {
        useErrMsg: true
    });
}

export function queryByOpenId(data: any) {
    return request.get<NurseNurses.NurseNurses>('/nurse_nurses/nurseNurses/queryByOpenId', data, {
        useErrMsg: true
    });
}

export function edit(data: any) {
    return request.post<any>('/nurse_nurses/nurseNurses/edit', data, {
        useErrMsg: true
    });
}

// 获取健康管家列表
export function getHealthNurses() {
    // const queryParams = new URLSearchParams();
    // if (params.column) queryParams.append('column', params.column);
    // if (params.order) queryParams.append('order', params.order);
    // if (params.pageNo) queryParams.append('pageNo', params.pageNo.toString());
    // if (params.pageSize) queryParams.append('pageSize', 1000);
    // if (params.isHealth !== undefined) queryParams.append('isHealth', params.isHealth.toString());
    
    return request.get<any>(`/nurse_nurses/nurseNurses/list`, {
        pageSize: 1000,
        pageNo: 1,
        isHealth: 1
    }, {
        useErrMsg: true
    });
}

